package org.sy.lab.多线程基础._2_同步._2_ReentrantLock._2_读写锁;

import java.util.concurrent.TimeUnit;

public class Read implements Runnable {
	
	private Counter counter;
	
	public Read(Counter counter) {
		this.counter = counter;
	}
	
	@Override
	public void run() {
		
		for (int i = 0; i < 10; i++) {
			counter.read();
			try {
				TimeUnit.SECONDS.sleep(1);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
